$(function () {
    $.post("/user/getUser",null,function (info) {
        var array = [];
        var obj = JSON.parse(info);
        $("#loginUser").html(obj.realName);
        for(var i=0;i<obj.roleList.length;i++){
            array[i] = obj.roleList[i].id;
        }

        $.post("/role/findGrade","id=1&roleId="+array,function (gradeList) {
            var gradeId = [];
            for(var i=0;i<gradeList.length;i++){
                gradeId[i] = gradeList[i].id;
            }
            var list = $("#ul li");
            for(var i=0;i<list.length;i++){
                var ddList = $(list[i]).find("dl").find("dd");
                for(var j=0;j<ddList.length;j++){
                    var id = $(ddList[j]).find("a").attr("id");
                    for(var k=0;k<gradeId.length;k++){
                        if(gradeId[k] == id){
                            $(ddList[j]).find("a").attr("style","");
                        }
                    }
                }
            }

        })
    })

})

function logOff() {
    location.href="/html/login/login.html";
}